package com.pb.web.action;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.pb.entity.House;
import com.pb.entity.Street;

public class HouseAction extends ActionSupport {

	private static final long serialVersionUID = 8860356833945086885L;

	private House house;

	/**
	 * 获取 house
	 * 
	 * @return house
	 */
	public House getHouse() {
		return house;
	}

	/**
	 * 设置 house
	 * 
	 * @param house
	 *            house
	 */
	public void setHouse(House house) {
		this.house = house;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		Street street = new Street(1, "中关村");
		house = new House(1, street, "好房子");
		Map<String, String> request = (Map<String, String>) ActionContext
				.getContext().get("request");
		request.put("r1", "值1");
		return SUCCESS;
	}
}
